package com.lxyk.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ControllerExceptionAdvice {

    //只有出现AccessDeniedException异常才执行这个方法, 跳转403.jsp页面
    @ExceptionHandler(Exception.class)
    public String exceptionAdvice(Exception e){
        e.printStackTrace();
        return "forward:/403.jsp";
    }
}
